package com.jiaoyou.baojian.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.jiaoyou.baojian.fragment.RankListFragment;
import com.jiaoyou.baojian.utils.Utils;

/**
 * Created by DemonZYM on 17/4/12.
 */

public class MeihuoTabPagerAdapter extends FragmentPagerAdapter {
    public MeihuoTabPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        return RankListFragment.newInstance("ATTRACTIVENESS", Utils.getRankRange(getPageTitle(position).toString()));
    }

    @Override
    public int getCount() {
        return 4;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        switch (position) {
            case 0:
                return "日榜";
            case 1:
                return "周榜";
            case 2:
                return "月榜";
            case 3:
                return "总榜";
        }
        return null;
    }
}
